<script setup lang="ts">
import { onLoad } from '@dcloudio/uni-app';
import { GetVideoAllAPI } from '@/services/video';
import { ref } from 'vue';
import type { videoAll } from '@/types/video'
//定义视频类型
const video = ref<videoAll>()
//获取视频id
const query = defineProps<{
  id: number
}>()
//获取视频数据
const GetVideoAllData = async (id: number) => {
  const res = await GetVideoAllAPI(id)
  video.value = res.data
  console.log(video.value)
}
//初始化
onLoad(() => {
  GetVideoAllData(query.id)
}
)


</script>
<template>
  <hyp-player :src="video?.url"></hyp-player>
</template>
